<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Jedrzej\Pimpable\PimpableTrait;

class UserFriends extends Model
{
    use HasFactory;
    use PimpableTrait;
//    use SoftDeletes;

    /**
     * 可执行搜索的字段
     */
    public $searchable = [
        'user_id',
        'friends_uid'
    ];

    /**
     * 可批量赋值字段
     */
    public $fillable = [
        'user_id',
        'friends_uid',
    ];

    /**
     * 默认使用倒叙的字段
     */
    public $defaultSortCriteria = [
        'id,desc',
    ];

    /**
     * 账单关联用户的id
     */
    public function user()
    {
        return $this->belongsTo(User::class,'user_id','id');
    }
}
